module DocumentCategoriesHelper
  def document_category_name_value
    if action_name == "show"
      h @document_category.name 
    else
      text_field :document_category, :name 
    end
  end

  def document_category_url_value
    if action_name == "show"
      h @document_category.url
    end
  end

  def document_category_description_value
    if action_name == "show"
      @document_category.description
    else
      text_area :document_category, :description
    end
  end

  def document_category_folder_value
    if action_name == "show"
      unless @document_category.folder.nil?        
        h @document_category.folder.name
      else
         "No folder."
       end  
     else
       select :document_category, :folder_id , Folder.find(:all).map { |f| [ f.qualified_name, f.id ] }, { :include_blank => true }
     end
   end

  # Note::
  # document_category_documents_value is defined in application helper because
  # it is used in the page view as well
end
